package org.aileen.blog.mapper;


import org.aileen.blog.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserInfoMapper {

    /**
     * 根据名称,查询用户信息
     * 结合页面我们可知道查询用户登录之后登录界面中展示的信息
     */
    @Select("select id , user_name ,password , github_url from `user` where user_name = #{userName} and delete_flag = 0")
    UserInfo selectByName(String name);

    /**
     * 根据ID查询用户信息
     */
    @Select("select id ,user_name , github_url from `user` where id = #{id} and delete_flag = 0")
    UserInfo selectById(Integer id);

}
